import { createRouter, createWebHistory } from '@ionic/vue-router';
import { RouteRecordRaw } from 'vue-router';
//import LoginPage from '../views/LoginPage.vue'
import TabsPage from '../views/TabsPage.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/tabs/eventlist'
  },
  // {
  //   path: '/',
  //   name:'Login',
  //   component:LoginPage
  // },
  {
    path: '/',
    redirect: '/tabs/eventlist'
  },
  {
    path: '/eventdetails/:item',
    name:'eventdetails',
    component: () => import('@/views/EventDetails.vue'),
    props: true
  },
  {
    path: '/noticedetails',
    name:'noticedetails',
    component: () => import('@/views/NoticeDetails.vue')
  },
  {
    path: '/tabs/',
    component: TabsPage,
    children: [
      {
        path: '',
        redirect: '/tabs/eventlist'
      },
      {
        path: 'eventlist',
        component: () => import('@/views/EventList.vue'),
      },
      {
        path: 'noticelist',
        component: () => import('@/views/NoticeList.vue')
      },
      {
        path: 'tab3',
        component: () => import('@/views/Tab3Page.vue')
      },
      {
        path: 'tab4',
        component: () => import('@/views/Tab4Page.vue')
      },
    ]
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router
